package com.sky;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@EnableTransactionManagement //开启注解方式的事务管理
@Slf4j
@EnableCaching  // 开启spring cache注解功能,开启缓存注解功能
@EnableScheduling   //开启任务调度
public class SkyApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext application = SpringApplication.run(SkyApplication.class, args);
        Environment env = application.getEnvironment();
        log.info("\n----------------------------------------------------------\n\t" +
                        "应用文档启动成功! 访问连接:\n\t" +
                        "Swagger文档: \t\thttp://localhost:{}/doc.html\n" +
                        "----------------------------------------------------------",
                env.getProperty("server.port"));
    }
}
